package com.dhcc.DRGsHosp.facade.impl.assembler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.dhcc.DRGsHosp.core.domain.ManageSummary;
import com.dhcc.DRGsHosp.facade.dto.ManageSummaryDTO;

public class ManageSummaryAssembler {

	public static ManageSummaryDTO toDTO(ManageSummary manageSummary) {
		if (manageSummary == null) {
			return null;
		}
		ManageSummaryDTO result = new ManageSummaryDTO();
		result.setMsCode( manageSummary.getMsCode() );
		result.setMsFlag( manageSummary.getMsFlag() );
		return result;
	}

	public static List<ManageSummaryDTO> toDTOs(Collection<ManageSummary> manageSummarys) {
		if (manageSummarys == null) {
			return null;
		}
		List<ManageSummaryDTO> results = new ArrayList<ManageSummaryDTO>();
		for (ManageSummary each : manageSummarys) {
			results.add(toDTO(each));
		}
		return results;
	}

	public static ManageSummary toEntity(ManageSummaryDTO manageSummaryDTO) {
		if (manageSummaryDTO == null) {
			return null;
		}
		ManageSummary result = new ManageSummary();
		result.setMsCode(manageSummaryDTO.getMsCode()) ;
		result.setMsFlag(manageSummaryDTO.getMsFlag());
		return result;
	}

	public static List<ManageSummary> toEntities(Collection<ManageSummaryDTO> manageSummaryDTOs) {
		if (manageSummaryDTOs == null) {
			return null;
		}

		List<ManageSummary> results = new ArrayList<ManageSummary>();
		for (ManageSummaryDTO each : manageSummaryDTOs) {
			results.add(toEntity(each));
		}
		return results;
	}
}
